import javax.swing.*;
import java.util.concurrent.TimeUnit;

/**
 * @author 杨宇
 * @date Created on 2016/6/14.
 */
public class E03_SubmitSwingProgram extends JFrame{
    JLabel label;

    public E03_SubmitSwingProgram(){
        label = new JLabel("A Label");
        add(label);
    }
    static E03_SubmitSwingProgram ssp;

    public static void main(String[] args) throws InterruptedException {
        SwingConsole.run(ssp = new E03_SubmitSwingProgram(), 300, 100);

        TimeUnit.SECONDS.sleep(2);
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                ssp.label.setText("Hey! This is Different!");
            }
        });
    }
}
